package com.heima.user.controller.v1;


import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.URLUtil;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.model.user.dtos.LoginDto;
import com.heima.user.service.ApUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("api/v1")
@Api(tags = "用户接口")
public class ApUserController {
    @Autowired
    private ApUserService apUserService;

    @PostMapping("/login/login_auth")
    @ApiOperation("登录")
    public ResponseResult login(@RequestBody LoginDto loginDto){
        return apUserService.login(loginDto);
    }
    @PostMapping("/test")
    @ApiOperation("测试")
    public ResponseResult test(@RequestHeader("id")Long id){
        log.info("接收到载荷{}",id);
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }

}
